package com.heaboy.feedback.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.heaboy.feedback.mapper.StudentAttendanceMapper;
import com.heaboy.feedback.domain.StudentAttendance;
import com.heaboy.feedback.service.IStudentAttendanceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
 * 学生签到Service业务层处理
 * 
 * @author heaboy
 * @date 2024-02-01
 */
@Service
public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceMapper, StudentAttendance> implements IStudentAttendanceService
{
    @Autowired
    private StudentAttendanceMapper studentAttendanceMapper;

    /**
     * 查询学生签到
     * 
     * @param id 学生签到主键
     * @return 学生签到
     */
    @Override
    public StudentAttendance selectStudentAttendanceById(Long id)
    {
        return studentAttendanceMapper.selectStudentAttendanceById(id);
    }

    /**
     * 查询学生签到列表
     * 
     * @param studentAttendance 学生签到
     * @return 学生签到
     */
    @Override
    public List<StudentAttendance> selectStudentAttendanceList(StudentAttendance studentAttendance)
    {
        return studentAttendanceMapper.selectStudentAttendanceList(studentAttendance);
    }

    /**
     * 新增学生签到
     * 
     * @param studentAttendance 学生签到
     * @return 结果
     */
    @Override
    public int insertStudentAttendance(StudentAttendance studentAttendance)
    {
        studentAttendance.setCreateTime(DateUtils.getNowDate());
        return studentAttendanceMapper.insertStudentAttendance(studentAttendance);
    }

    /**
     * 修改学生签到
     * 
     * @param studentAttendance 学生签到
     * @return 结果
     */
    @Override
    public int updateStudentAttendance(StudentAttendance studentAttendance)
    {
        studentAttendance.setUpdateTime(DateUtils.getNowDate());
        return studentAttendanceMapper.updateStudentAttendance(studentAttendance);
    }

    /**
     * 批量删除学生签到
     * 
     * @param ids 需要删除的学生签到主键
     * @return 结果
     */
    @Override
    public int deleteStudentAttendanceByIds(Long[] ids)
    {
        return studentAttendanceMapper.deleteStudentAttendanceByIds(ids);
    }

    /**
     * 删除学生签到信息
     * 
     * @param id 学生签到主键
     * @return 结果
     */
    @Override
    public int deleteStudentAttendanceById(Long id)
    {
        return studentAttendanceMapper.deleteStudentAttendanceById(id);
    }
}
